$(window).load(function(){
	$('.small-show').hover(function(){
		$('.large-show').css('display','block');
		$('.small-show .flow-layer').css('display','block');
	},function(){
		$('.large-show').css('display','none');
		$('.small-show .flow-layer').css('display','none');
	})
	$('.small-show').mousemove(function(e){
		var evt = e || event;
		var x = evt.clientX-$(this).offset().left-$('.flow-layer').width()/2;
		var y = evt.clientY-$(this).offset().top-$('.flow-layer').height()/2;
		if(x<0){
			x=0;
		}else if(x>$(this).width()-$('.flow-layer').width()){
			x=$(this).width()-$('.flow-layer').width();
		}
		$('.flow-layer').css('left',x);
		if(y<0){
			y=0;
		}else if(y>$(this).height()-$('.flow-layer').height()){
			y=$(this).height()-$('.flow-layer').height();
		}
		$('.flow-layer').css('top',y);
		
		var percentX = x/($(this).width()-$('.flow-layer').width());
		var percentY = y/($(this).height()-$('.flow-layer').height());
		
		$('.large-show img').css({
			'left':-percentX * ($('.large-show img').width()-$('.large-show').width()),
			'top':-percentY * ($('.large-show img').height()-$('.large-show').height())}
		)
	})
	$('.x-show div').mouseenter(function(){
		var iIndex = $(this).index()+1;
		console.log(iIndex)
		$('.small-show img').attr('src','img/LTV-Small'+iIndex+'.jpg');
		$('.large-show img').attr('src','img/LTV-Large'+iIndex+'.jpg');
		
	})
	
//	$.ajax('https://gm.mmstat.com/tmallrate.6.2.7?logtype=2&&_tm_cache=1468640078673',{
//		success:function(data){
//			console.log(data)
//		},
//		dataType:'jsonp',
//		jsonp:'jsonpcallback',
//	})
	
})
